
<?php
use application\Comm\Func;
use application\Comm\Request;
use application\Module\Adtext;
use library\Core\Config;
$adtext = new Adtext();
$ad_text_pid = Config::getParamsVal('PRODUCT_CATEGORY');

$categoryRewrite = Config::getParamsVal('PRODUCT_CATEGORY_REWRITE');
$urlParam = [];
foreach ($categoryRewrite as $key => $val){
	$urlParam[$key] = ['space'=>$val];
}
$style = Config::getParamsVal('STYLE');
$func = Config::getParamsVal('FUNCTION');
$price = Config::getParamsVal('PRICE');
$price_all = Config::getParamsVal('PRICE_ALL');
$acreage = Config::getParamsVal('ACREAGE');

$ad_text_list = [];
foreach ($ad_text_pid as $k => $v) {
    $ad_text_list[$k] = $adtext->getList($k);
}
?>
<!--顶部广告-->

<!--头部-->
<div class="header">
	<main class="main">
    <div class="main_top container">
        <div class="float-right">
            <span title="您好，欢迎来到丽博家具官网商城！"style="cursor: default">您好，欢迎来到丽博家具官网商城！</span>
            <ul style="margin-left:30px;">
                <li><a title="帮助中心" href="javascript:void(0);">帮助中心</a></li>
                <li><a title="手机商城" href="javascript:void(0);">手机商城</a></li>
                <li><a title="收藏网站" href="javascript:void(0);" onclick="collect();">收藏</a></li>
                <li><a title="关注" href="javascript:void(0);">关注</a></li>
                <li><a title="服务热线：400-790-8890" href="javascript:void(0);">服务热线：400-790-8890</a></li>
            </ul>
        </div>
        <div style="clear: both"></div>
    </div>
</main>

<!-- LOGO -->
<div class="logo">
    <div class="container">
        <div class="logo-img">
            <a href="<?php echo Func::createUrl('site/index')?>"><img title="丽博橱柜，全屋定制" src="<?php echo Func::staticUrl('images/index/LOGO.jpg')?>" alt="logo"></a>
            <div class="logo-inp float-right">
                <form action="<?= Func::createUrl('product/index') ?>" method="get">
                    <input type="text" placeholder="请输入搜索内容">
                    <button type="submit">
                        <img class="search" src="<?php echo Func::staticUrl('images/index/search.jpg')?>" alt="搜索">
                    </button>
                </form>
                <a title="免费预约量尺" href="<?= Func::createUrl('site/apply') ?>"><img class="reservation" src="<?php echo Func::staticUrl('images/index/reservation.jpg')?>" alt="免费预约量尺设计"></a>
            </div>
        </div>
    </div>
</div>

<nav class="nav">
    <div class="container">
        <!-- 导航部分 -->
        <div class="nav_ul">
            <h3 class="nav_stop"><i class="fa fa-bars"></i>&nbsp;所有空间分类</h3>
            <ul>
                <li><a href="<?php echo Func::createUrl('site/index')?>"
                        <?php if (Func::ifurl()==1)echo 'class="cur"'?>>商城首页</a></li>
                <li><a href="<?php echo Func::createUrl('house/index')?>"
                        <?php if (Func::ifurl()==5)echo 'class="cur"'?>>全屋定制</a></li>
                <li><a href="<?php echo Func::createUrl('site/flow')?>"
                        <?php if (Func::ifurl()==3)echo 'class="cur"'?>>服务流程</a></li>
                <li><a href="<?php echo Func::createUrl('site/stores')?>"
                        <?php if (Func::ifurl()==2)echo 'class="cur"'?>>全国门店</a></li>
                <li><a href="<?php echo Func::createUrl('site/brand')?>"
                        <?php if (Func::ifurl()==4)echo 'class="cur"'?>>品牌实力</a></li>
            </ul>
        </div>
    </div>
</nav>


<div class="banner">
    <div class="down container">
        <div class="down_menu" style="z-index: 1">
            <!-- 左 -->
            <div class="down_menu_l" <?php if ($this->route != 'site/index') echo 'style="display:none"'?>>
                <?php
                $cssIndex = 0;
                foreach ($ad_text_pid as $adKey => $sName):
                $cssIndex++;
                ?>
                <ul class="down_menu_lul">
                        <li>
                            <h1 class="menu_con<?=$cssIndex;?>"><i></i><a target="_blank" href="<?php echo Func::indexProductUrl('product/index', $urlParam[$adKey]) ?>"><b> <?=$sName;?></b></a></h1>

                                <?php $i = 9;
                                if (isset($ad_text_list[$adKey]) && !empty($ad_text_list[$adKey])) { ?>

                                <?php foreach ($ad_text_list[$adKey] as $k => $v) { ?>
                                <p>
                                <a href="<?=$v['url'] ?>" target='_blank' alt="<?=$v['name'] ?>"
                                   title="<?=$v['name'] ?>"><?=$v['name'] ?></a>
                                </p>

                    <?php }}?>
                        </li>
                </ul>
                <?php endforeach;?>

            </div>



            <!-- 右 -->
            <div class="down_menu_r">
                <?php
                $cssIndex = 0;
                foreach ($ad_text_pid as $adKey => $sName):
                    $cssIndex ++;
                ?>
                <ul class="down_menu_rul hide">
                    <li>
                        <h1>风格</h1>
                        <em><a  target="_blank" href="<?= Func::indexProductUrl('product/index', $urlParam[$adKey]) ?>">所有</a></em>
                        <?php foreach ($style as $key =>$val){
                            $styleParam = $urlParam[$adKey];
                            $styleParam['style_id'] = $key;
                            ?>
                            <a  target="_blank" href="<?php echo Func::indexProductUrl('product/index',$styleParam)?>"><?php echo $val;?></a>
                        <?php }?>

                    </li>
                    <li>
                        <h1>功能</h1>
                        <em><a  target="_blank" href="<?php echo Func::indexProductUrl('product/index',$urlParam[$adKey])?>">所有</a></em>
                        <?php foreach ($func[$adKey] as $k =>$v){
                            $funcParam = $urlParam[$adKey];
                            $funcParam['function_id'] = $k;
                            ?>
                            <a  target="_blank" href="<?php echo Func::indexProductUrl('product/index',$funcParam)?>"><?php echo $v;?></a>
                        <?php }?>

                    </li>
                    <li>
                        <h1>面积</h1>
                        <em><a  target="_blank" href="<?php echo Func::indexProductUrl('product/index',$urlParam[$adKey])?>">所有</a></em>
                        <?php foreach ($acreage[$adKey] as $k =>$v){
                            $acreageParam = $urlParam[$adKey];
                            $acreageParam['acreage_id'] = $k;
                            ?>
                            <a href="<?php echo Func::indexProductUrl('product/index',$acreageParam)?>"><?php echo $v?></a>
                        <?php }?>

                    </li>
                    <li>
                        <h1>价格</h1>
                        <em><a  target="_blank" href="<?php echo Func::indexProductUrl('product/index',$urlParam[$adKey])?>">所有</a></em>
                        <?php //foreach ($price as $k =>$v){
                        if (isset($price_all[$adKey])){
                            $priceParam = $urlParam[$adKey];
                            $priceParam['price_id'] = $k;
                            foreach ($price_all[$adKey] as $allkey =>$allval){
                                ?>
                                <a  target="_blank" href="<?= Func::indexProductUrl('product/index',$priceParam)?>"><?= $allval['lable']?></a>
                            <?php }}?>
                    </li>
                    <img src="<?php echo Func::staticUrl('images/index/'.$adKey.'.jpg?v=20170815')?>">
                </ul>
                <?php endforeach; ?>
            </div>

        </div>
    </div>
</div>

	<!--菜单-->
	
</div>
